{extend name="base" /} 
{block name="css"}
<link rel="stylesheet" href="__OEM__/css/iconfont.css" />
<style type="text/css">
	#sfz_pic{position: relative;}/*opacity: 0;*/
	 .upload,.upload1{position: absolute;top: 0;left: 0;width: 100%;height: 100%;opacity: 0;}
	#dp_pic{position: relative;}
	 .upload2{position: absolute;top: 0;left: 0;width: 100%;height: 100%;opacity: 0;}
	#yyzz_pic{position: relative;}
	 .upload3{position: absolute;top: 5%;left: 6%;height: 100%;width: 100%;opacity: 0;}
	#qt_pic{position: relative;}
	 .upload4{position: absolute;top: 5%;left: 6%;height: 100%;width: 100%;opacity: 0;}
</style>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>
<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css">
<script src="__PUBLIC__/static/layui/layui.js"></script>
{/block}

{block name="body"}
<div class="right">
	<div class="rigtop">
		<span class="title">商家认证</span>
	</div>
	<div class="indrig_con renz_con">
		<p class="renz_tip" style="margin-left:35%;font-size: 18px;color: red;">
			{if $data}
				{if $data['status'] == 1}
					审核中
				{elseif $data['status'] == 2}
					认证通过
				{else}
					<div class="shxx_item">
						<div class="shxx_title">审核失败原因：</div>
						<p class="renz_tip">{$data['not_pass_msg']}</p>
						{if count($data['not_pass_img']) >10}
						<div class="renz_img " id="yyzz_pic">
							<span>
								<img style="width: 35%;height: 200px;" src="{$data['not_pass_img']}" />
							</span>
						</div>
						{/if}
					</div>
				{/if}
			{/if}
		</p>
		<form id="my_form"  class="layui-form update_form" action="" method="post">
			<input type="hidden" name="id" value="{$data['id']}">
			<div class="shxx_item">
				<div class="shxx_title">认证基本信息</div>
				<div class="shxx_row clearfix">
					<div class="left"><em>*</em>身份证号</div>
					<div class="right">
						<div class="htrig_box">
							<div class="htrig_con">
								<input type="text" name="id_number" value="{$data['id_number']}" class="chax_input" placeholder="请输入身份证号码" lay-verify="required"  autocomplete="off">
							</div>
							<p class="redtip">身份证号不能为空</p>
						</div>
						<p class="wztip" style="color: #FF0000;">请确认您的身份证号码填写无误，该身份证号必须与您上传的身份证照片一致</p>
					</div>
				</div>
				<div class="shxx_row clearfix">
					<div class="left"><em>*</em>营业执照号</div>
					<div class="right">
						<div class="htrig_box">
							<div class="htrig_con">
								<input type="text" name="business_licence" value="{$data['business_licence']}" class="chax_input" placeholder="请输入银行卡号" lay-verify="required"  autocomplete="off">
							</div>
							<p class="redtip">营业执照编号不能为空</p>
						</div>
					</div>
				</div>
				<div class="shxx_row clearfix">
					<div class="left"><em>*</em>开户行</div>
					<div class="right">
						<div class="htrig_box">
							<div class="htrig_con">
								<input type="text" name="bank_name" value="{$data['bank_name']}" class="chax_input" placeholder="请输入开户行及分行" lay-verify="required"  autocomplete="off">
							</div>
							<p class="redtip">开户行不能为空</p>
						</div>
					</div>
				</div>
				<div class="shxx_row clearfix">
					<div class="left"><em>*</em>开户名</div>
					<div class="right">
						<div class="htrig_box">
							<div class="htrig_con">
								<input type="text" name="user_name" value="{$data['user_name']}" class="chax_input" placeholder="请输入开户人姓名" lay-verify="required"  autocomplete="off">
							</div>
							<p class="redtip">开户名不能为空</p>
						</div>
					</div>
				</div>
				<div class="shxx_row clearfix">
					<div class="left"><em>*</em>银行卡号</div>
					<div class="right">
						<div class="htrig_box">
							<div class="htrig_con">
								<input type="text" name="bank_no" value="{$data['bank_no']}" class="chax_input" placeholder="请输入银行卡号" lay-verify="required"  autocomplete="off">
							</div>
							<p class="redtip">银行卡号不能为空</p>
						</div>
					</div>
				</div>
				<div class="shxx_row clearfix">
					<div class="left"><em>*</em>预留手机号</div>
					<div class="right">
						<div class="htrig_box">
							<div class="htrig_con">
								<input type="text" name="reserve_mobile" value="{$data['reserve_mobile']}" class="chax_input" placeholder="请输入开户行及分行" lay-verify="required"  autocomplete="off">
							</div>
							<p class="redtip">开户行不能为空</p>
						</div>
					</div>
				</div>
			</div>
			<div class="shxx_item">
				<div class="shxx_title">证件影印件</div>
				<p class="renz_tip">请提交证件原件照片（证件如为复印件，请务必盖公章后再拍照上传），单个文件大小不能超过3M，格式支持.jpg.png</p>
				<ul class="renz_box clearfix">
					<li style="width: 45%;height: 200px;">
						<div class="renz_img " id="yyzz_pic">
							<input type="hidden" name="hand_card" id="hand_card" value="{$data['hand_card']}" lay-verify="required"/>
							<input type="file"  onchange="UploadFile_more('goods',200,'hand_card','hand_card_img','file1')" accept="image/*" id="file1" name="file" class="upload1" style="display: none;" />
							<span>
								<img style="width: 100%;height: 200px;" src="{if $data}{$data['hand_card']}{else}__OEM__/img/renz3.jpg{/if}" id="hand_card_img" class='img_2' onclick="$('input[id=file1]').click();"/>
							</span>
						</div>
						<div>手持身份证正面照片</div>
					</li>
					<li style="width: 45%;height: 200px;">
						<div class="renz_img" id="yyzz_pic">
							<input type="hidden" name="id_card_front" id="id_card_front" value="{$data['id_card_front']}" lay-verify="required"/>
							<input type="file"  onchange="UploadFile_more('goods',200,'id_card_front','id_card_img','file2')" accept="image/*" id="file2" name="file" class="upload1" style="display: none;" />
							<span>
								<img style="width: 100%;height: 200px;" src="{if $data}{$data['id_card_front']}{else}__OEM__/img/renz.jpg{/if}" id="id_card_img" class='img_2' onclick="$('input[id=file2]').click();"/>
							</span>
						</div>
						<div>身份证正面照片</div>
					</li>
					<li style="width: 45%;height: 200px;">
						<div class="renz_img " id="yyzz_pic">
							<input type="hidden" name="bank_card_front" id="bank_card_front" value="{$data['bank_card_front']}" lay-verify="required"/>
							<input type="file"  onchange="UploadFile_more('goods',200,'bank_card_front','bank_card_img','file3')" accept="image/*" id="file3" name="file" class="upload1" style="display: none;" />
							<span>
								<img style="width: 100%;height: 200px;" src="{if $data}{$data['bank_card_front']}{else}__OEM__/img/renz4.jpg{/if}" id="bank_card_img" class='img_2' onclick="$('input[id=file3]').click();"/>
							</span>
						</div>
						<div>银行卡正面照片</div>
					</li>
					<li style="width: 45%;height: 200px;">
						<div class="renz_img " id="yyzz_pic">
							<input type="hidden" name="license" id="license" value="{$data['license']}" lay-verify="required"/>
							<input type="file"  onchange="UploadFile_more('goods',200,'license','license_img','file4')" accept="image/*" id="file4" name="file" class="upload1" style="display: none;" />
							<span>
								<img style="width: 100%;height: 200px;" src="{if $data}{$data['license']}{else}__OEM__/img/renz5.jpg{/if}" id="license_img" class='img_2' onclick="$('input[id=file4]').click();"/>
							</span>
						</div>
						<div>营业执照副本照片</div>
					</li>
				</ul>
			</div>
			<div class="layui-form-item update_btnbox">
				<button  id='change_but'  class="layui-btn renz_btn {if $data['status'] == 2 || $data['status'] == 1} layui-btn-disabled {/if}" lay-submit lay-filter="demo1">立即提交</button>
			</div>
		</form>
	</div>
</div>

{/block} 
{block name="script"} 
<script type="text/javascript" src="__PUBLIC__/static/js/image.zip.js"></script>
<script>
function set_content(){
 $.ajax({
     	type:"post",
        url:"{:url('index/verif')}",
        data: $('#my_form').serialize(),
        success:function(data){
            layer.msg(data.msg, {
				  icon: 1,
				  time: 1500 
				}, function(){
					if(data.code != 200){
						location.reload();
					}
			});
        }
});
	
}
//图片上传
layui.use(['form'], function(){
	var $ = layui.jquery,form = layui.form;
  	//监听提交
	form.on('submit(demo1)', function(data){
		$('#change_but').addClass("layui-btn-disabled");
		set_content();
		return false;
	});
})
</script>
{/block}